From d6955d4427f1910c22c3b23ffaf5202fdb0a6cf0 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Fri, 31 Jul 2020 18:44:10 +0800 Subject: [PATCH] gskrenderer.c: Default to the GL renderer on Windows too Since we have now made the Win32 GL contexts share the global context as the other backends have, we are more ready to use the GL renderer by default on Windows as well. Note that currently we can only enable this when not running on OpenGL/ES as the OpenGL/ES shaders are not ready at this point, and the OpenGL/ES support that we have from libANGLE does not support full desktop OpenGL operations. --- gsk/gskrenderer.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gsk/gskrenderer.c b/gsk/gskrenderer.c index 5f4b1deeb8..1ac74110f9 100644 --- a/gsk/gskrenderer.c +++ b/gsk/gskrenderer.c @@ -63,6 +63,13 @@ #ifdef GDK_WINDOWING_MACOS #include #endif +#ifdef GDK_WINDOWING_WIN32 +#include + +/* Remove these lines when OpenGL/ES 2.0 shader is ready */ +#include "win32/gdkprivate-win32.h" +#include "win32/gdkdisplay-win32.h" +#endif typedef struct { @@ -562,6 +569,17 @@ get_renderer_for_backend (GdkSurface *surface) if (GDK_IS_MACOS_SURFACE (surface)) return GSK_TYPE_GL_RENDERER; #endif +#ifdef GDK_WINDOWING_WIN32 + if (GDK_IS_WIN32_SURFACE (surface)) + /* remove check for OpenGL/ES when OpenGL/ES 2.0 shader is ready */ + { + GdkDisplay *display = gdk_surface_get_display (surface); + + if (!(GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES) || + GDK_WIN32_DISPLAY (display)->running_on_arm64)) + return GSK_TYPE_GL_RENDERER; + } +#endif return G_TYPE_INVALID; } -- 2.30.2